<%@page import="com.skeleton.db.dto.UserinfoDto"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Insert title here</title>
	<script type="text/javascript" src="<%=request.getContextPath() %>/resource/js/jquery-1.8.2.js"></script>
	<script type="text/javascript">
		function testAjax() {
			$.ajax({
				type:"POST",
				url: "ajaxAllUser",
				dataType:"json",
				success:function(res) {
					if(res.result == "success") {
						var list = res.list;
						$.each(list, function() {
							alert(this.userName);
						});
					} else {
						alert(res.msg);
					}
				},
				error:function(e,msg,t) {
					alert(msg+t);
				}
			});
		}
	</script>
</head>
<body>
	<input type="button" value="测试ajax" onclick="testAjax()"/><br />
	<%
		List<UserinfoDto> list = (List<UserinfoDto>)request.getAttribute("list");
		for(int i=0; i<list.size(); i++) {
			UserinfoDto u = list.get(i);
	%>
			<%=u.getUserNickname() %><br />
	<%	} %>
</body>
</html>